package com.woniuxy.aspectj;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.JoinPoint;

public class MyAspectJ {
    /**
     * 前置通知
     * ChangeLog : 1. 创建 (22/03/28/0028 下午 3:28 [马宇航]);
     * @param joinpoint  连接点
     * @return void
     */
    public void myBefore(JoinPoint joinpoint){
        System.out.println("前置通知：日志打印开始……");
        System.out.println("对应目标类是："+joinpoint.getTarget());
        System.out.println("对应目标类的方法是："+joinpoint.getSignature().getName());
    }
    public void afterReturing(JoinPoint joinpoint){
        System.out.println("后置通知：事务提交开始……");
        System.out.println("对应目标类是："+joinpoint.getTarget());
        System.out.println("对应目标类的方法是："+joinpoint.getSignature().getName());
    }
}
